#include <iostream>
using namespace std;
int main()
{
    int matrix[20][20];
    int n;
    cin>>n;
    int sum = 0;
    for(int row = 0; row<n; row++)
    {
        for(int col = 0; col<n; col++)
        {
            
            cin>>matrix[row][col];
            sum = sum + matrix[row][col];
        }
    }
    double ave = (double)sum / (n*n);
    bool ifFind = false;
    for(int row = 0; row<n; row++)
    {
        for(int col = 0; col<n; col++)
        {
             if(matrix[row][col] > ave)
             {
                 cout<<matrix[row][col]<<" "<< row <<" "<< col<<endl;
                 ifFind = true;
             }
        }
    }
    if(!ifFind)
        cout<<"0";
    
}